/* eslint-disable */
import HttpUtil from '@/common/HttpUtil'
// import Config from '@/common/config'

const systemApi = {

  /**
   * 00-02新增用户
   */
  addUser(params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/sys/user/add'
    return HttpUtil.post(postUrl, params)
  },
  /**
   * 00-02获取用户列表
   * @param {PageIndex: 1, PageSize: 20, AccountOrName: '-'}
   */
  getUserList(params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/sys/user/getList'
    return HttpUtil.get(postUrl, params)
  },
  findPageUser(param) {
    let postUrl = process.env.SURVEY_DOMAIN + '/sys/user/findPageUser'
    return HttpUtil.postJSON(postUrl, param)
  },
  getUser(id) {
    let getUrl = process.env.SURVEY_DOMAIN + '/sys/user/getUser/' + id
    return HttpUtil.get(getUrl, null)
  },
  /**
   * 00-02修改用户信息 put
   * @param
   * {
	  } params
   */
  updateUser(params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/sys/user/update'
    return HttpUtil.put(postUrl, params)
  },
  /**
   * 00-02删除单个用户
   * @param "UserID": "79551"
   */
  deleteUser(id) {
    let postUrl = process.env.SURVEY_DOMAIN + '/sys/user/delete/' + id
    return HttpUtil.delete(postUrl, null)
  },

  // =====角色=====
  /**
   * 00-02新增角色
   */
  addRole(params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/admin/sys/role/add'
    return HttpUtil.post(postUrl, params)
  },
  /**
   * 00-02获取角色列表
   * @param {PageIndex: 1, PageSize: 20, AccountOrName: '-'}
   */
  getRoleList(params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/admin/sys/role/getList'
    return HttpUtil.get(postUrl, params)
  },
  /**
   * 00-02修改角色信息 put
   * @param
   * {
	  } params
   */
  updateRole(params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/admin/sys/role/update'
    return HttpUtil.put(postUrl, params)
  },
  /**
   * 00-02删除单个角色
   * @param "UserID": "79551"
   */
  deleteRole(params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/admin/sys/role/delete'
    return HttpUtil.delete(postUrl, params)
  },
  /**
   * 00-02获取角色权限列表
   */
  getPermissionsList(params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/admin/sys/role/getRightList'
    return HttpUtil.get(postUrl, params)
  },
  /**
   * 00-02提交角色授权
   */
  roleAuthorize(params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/admin/sys/role/authorize'
    return HttpUtil.post(postUrl, params)
  },

  // =====部门=====
  /**
   *保存部门数据
   * @param params
   */
  saveDepartment(params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/sys/department/save'
    return HttpUtil.postJSON(postUrl, params)
  },
  /**
   * 00-02获取部门列表
   * @param {PageIndex: 1, PageSize: 20, AccountOrName: '-'}
   */
  getDeparmentList() {
    let postUrl = process.env.SURVEY_DOMAIN + '/sys/department/getList'
    return HttpUtil.get(postUrl, null)
  },
  getDepartmentInfo (param) {
    let url = process.env.SURVEY_DOMAIN + '/sys/department/getInfo/' + param
    return HttpUtil.get(url, null)
  },
  findDepartPage(params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/sys/department/findPage'
    return HttpUtil.post(postUrl, params)
  },
  editUser(params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/sys/user/editUser'
    return HttpUtil.postJSON(postUrl, params)
  },
  /**
   * 00-02删除单个部门
   * @param "UserID": "79551"
   */
  deleteDeparment(id) {
    let postUrl = process.env.SURVEY_DOMAIN + '/sys/department/delete/' + id
    return HttpUtil.delete(postUrl, null)
  },

  // =====岗位=====
  /**
   * 00-02新增岗位
   */
  addPost(params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/admin/sys/position/add'
    return HttpUtil.post(postUrl, params)
  },
  /**
   * 00-02获取岗位列表
   * @param {PageIndex: 1, PageSize: 20, AccountOrName: '-'}
   */
  getPostList(params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/admin/sys/position/getList'
    return HttpUtil.get(postUrl, params)
  },
  /**
   * 00-02修改岗位信息 put
   * @param
   * {
	  } paramsPost
   */
  updatePost(params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/admin/sys/position/update'
    return HttpUtil.putJSON(postUrl, params)
  },
  /**
   * 00-02删除单个岗位
   * @param "UserID": "79551"
   */
  delete(params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/admin/sys/position/delete'
    return HttpUtil.delete(postUrl, params)
  },
  /**
   * 00-02获取岗位权限列表
   */
  getPostPermissionsList(params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/admin/sys/position/getRightList'
    return HttpUtil.get(postUrl, params)
  },
  /**
   * 00-02岗位人员批量分配
   */
  PostDistribution(params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/admin/sys/position/assignUsers'
    return HttpUtil.post(postUrl, params)
  },
  /**
   * 00-02岗位人员取消分配
   */
  CancelPostDistribution(params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/admin/sys/position/assignUsers'
    return HttpUtil.post(postUrl, params)
  },

  /**
   * 00-02获取岗位人员列表
   */
  getPostUserList(params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/admin/sys/position/getUserList'
    return HttpUtil.get(postUrl, params)
  },

  /**
   * 00-02岗位授权
   */
  permissionsOfPosts(params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/admin/sys/position/authorize'
    return HttpUtil.post(postUrl, params)
  },

  // =====参数=====
  /**
   * 00-02更新参数值 put
   * @param
   * {
	  } paramsPost
   */
  updateparams(params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/admin/sys/param/update'
    return HttpUtil.put(postUrl, params)
  },
  /**
   * 00-02获取参数详情
   */
  getParamDetail(params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/admin/sys/param/getParamDetail'
    return HttpUtil.get(postUrl, params)
  },
  /**
   * 00-02获取参数列表
   */
  getParamInfos(params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/admin/sys/param/getParamInfos'
    return HttpUtil.get(postUrl, params)
  },
  /**
   * 00-02获取参数分类列表
   */
  getParamCategories(params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/admin/sys/param/getParamCategories'
    return HttpUtil.get(postUrl, params)
  },

  // =====日志=====
  /**
   * 00-02分页获取日志列表
   * @param {PageIndex: 1, PageSize: 20, AccountOrName: '-'}
   */
  getLogList(params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/admin/sys/log/getListByPage'
    return HttpUtil.get(postUrl, params)
  },
  /**
   * 00-02获取日志详情
   */
  getLogDetail(params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/admin/sys/log/getDetail'
    return HttpUtil.get(postUrl, params)
  },

  // =====数据备份=====
  /**
   * 00-02数据备份
   */
  dataBackup(params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/admin/sys/data/backup'
    return HttpUtil.post(postUrl, params)
  },
  /**
   * 00-02获取日志详情
   */
  getBackupList(params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/admin/sys/data/getBackupList'
    return HttpUtil.get(postUrl, params)
  },

  // ===主菜单====
  /**
   * 00-02获取主菜单信息
   */
  getMainMenuList(params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/admin/sysmanagement/module/findAllModule'
    return HttpUtil.get(postUrl, params)
  },

  /**
   * 00-02获取根级目录信息
   */
  getBasisCatalogList(params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/admin/sysmanagement/module/findParentModule'
    return HttpUtil.get(postUrl, params)
  },

  /**
   * 00-02新增主菜单
   */
  addMainMenu(params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/admin/sysmanagement/module/addModule'
    return HttpUtil.post(postUrl, params)
  },

  /**
   * 00-02更新单个菜单
   * @param "UserID": "79551"
   */
  updataMainMenu(params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/admin/sysmanagement/module/updateModule'
    return HttpUtil.post(postUrl, params)
  },

  /**
   * 00-02删除单个菜单
   * @param "UserID": "79551"
   */
  deleteMainMenu(params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/admin/sysmanagement/module/deleteModule'
    return HttpUtil.post(postUrl, params)
  },

  // ===子菜单====
  /**
   * 00-02获取子菜单信息
   */
  getSubMenuList(params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/admin/sysmanagement/module/findAllModuleItem'
    return HttpUtil.get(postUrl, params)
  },

  /**
   * 00-02获取子菜单下一级子菜单信息
   */
  getBasisSubMenuList(params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/admin/sysmanagement/module/findModuleItemByModuleId'
    return HttpUtil.get(postUrl, params)
  },

  /**
   * 00-02新增子菜单
   */
  addSubMenu(params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/admin/sysmanagement/module/addModuleItem'
    return HttpUtil.post(postUrl, params)
  },

  /**
   * 00-02更新单个子菜单
   * @param "UserID": "79551"
   */
  updataSubMenu(params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/admin/sysmanagement/module/updateModuleItem'
    return HttpUtil.post(postUrl, params)
  },

  /**
   * 00-02删除单个子菜单
   * @param "UserID": "79551"
   */
  deleteSubMenu(params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/admin/sysmanagement/module/deleteModuleItem'
    return HttpUtil.post(postUrl, params)
  },
  findRoleList() {
    let postUrl = process.env.SURVEY_DOMAIN + '/sys/role/findList'
    return HttpUtil.get(postUrl, null)
  },
  getDepartmentRelation (param) {
    let postUrl = process.env.SURVEY_DOMAIN + '/sys/department/getRelation/' + param
    return HttpUtil.get(postUrl, null)
  },
  saveDepartmentRelation (params) {
    let postUrl = process.env.SURVEY_DOMAIN + '/sys/department/saveRelation'
    return HttpUtil.postJSON(postUrl, params)
  },
  findSpeciesList () {
    let postUrl = process.env.SURVEY_DOMAIN + '/gr/speciesManage/findAll'
    return HttpUtil.post(postUrl, null)
  }
}
export default systemApi
